import request from '@/utils/request'

// 查询惠企政策列表
export function listEnterprise(query) {
  return request({
    url: '/wanzhi/enterprise/list',
    method: 'get',
    params: query
  })
}

// 查询惠企政策详细
export function getEnterprise(id) {
  return request({
    url: '/wanzhi/enterprise/' + id,
    method: 'get'
  })
}

// 新增惠企政策
export function addEnterprise(data) {
  return request({
    url: '/wanzhi/enterprise',
    method: 'post',
    data: data
  })
}

// 修改惠企政策
export function updateEnterprise(data) {
  return request({
    url: '/wanzhi/enterprise',
    method: 'put',
    data: data
  })
}

// 删除惠企政策
export function delEnterprise(id) {
  return request({
    url: '/wanzhi/enterprise/' + id,
    method: 'delete'
  })
}

//总金额-总次数
export function getTotal(data) {
  return request({
    url: `/wanzhi/enterprise/updateSum?payFrequencyEnterprise=${data.payFrequencyEnterprise}&payFrequencyPerson=${data.payFrequencyPerson}&payAmountEnterprise=${data.payAmountEnterprise}&payAmountPerson=${data.payAmountPerson}`,
    method: 'get',
    data: data
  })
}


//金额总数
export function getMount(params) {
  return request({
    method: "GET",
    url: "http://172.19.166.130:8081/businessEnvironment/benefitPolicyStatics",
    params
  });
}
